const path = require('path');
const HtmlWebpackPlugin = require("html-webpack-plugin");
module.exports = {
    entry: {
        main: './src/App.js'
    },
    output: {
        filename: 'js/[name].js',
        path: path.resolve(__dirname, 'dist'),
        publicPath:"http://127.0.0.1:8080/"
    },
    plugins:[
        new HtmlWebpackPlugin({
            filename:"index.html",
            template:"index.html",
            inject:"head"
        })
    ],
    module: {
        rules: [
            {
                test: /\.js$/,
                exclude: path.resolve(__dirname, 'node_modules'),
                include: path.resolve(__dirname, 'src'),
                use: [
                    {
                        loader: 'babel-loader',
                        options: {
                            presets: ['latest']
                        }
                    }
                ]
            }
        ]
    }
};